package org.truenewx.tnxjee.service.exception;

import java.io.Serial;

/**
 * 没有操作权限的异常
 */
public class NoOperationAuthorityException extends BusinessException {

    @Serial
    private static final long serialVersionUID = -3432282540107390181L;

    public NoOperationAuthorityException(String operation) {
        super(getCode(operation), operation);
    }

    public NoOperationAuthorityException() {
        this(null);
    }

    private static String getCode(String operation) {
        return operation == null ? "error.service.security.no_this_operation_authority"
                : "error.service.security.no_specified_operation_authority";
    }

}
